package com.holly.mapper;

import com.holly.pojo.Student;
import com.holly.pojo.StudentQueryParam;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author holly
 * @create 2025-07-03 13:31
 */
@Mapper
public interface StudentMapper {

    @Select("select id from student where clazz_id = #{clazzId}")
    List<Integer> getStudentByClazzId(Integer clazzId);

    List<Student> list(StudentQueryParam param);

    void insert(Student student);

    Student getById(Integer id);

    void update(Student student);

    void delete(List<Integer> ids);

    void updateViolation(Integer id, Integer scoreNum);

    @MapKey("name")
    List<Map> countStudentDegreeData();
}
